# coding: utf-8
from . import db, BaseModel


class Usertoken(BaseModel):
    __tablename__ = 'usertoken'

    autoID = db.Column(db.BigInteger, primary_key=True)
    userID = db.Column(db.String(50), info='用户ID')
    userToken = db.Column(db.String(500), info='token值')
    expireTime = db.Column(db.DateTime, info='token过期时间')
    loginIP = db.Column(db.String(255, 'utf8_general_ci'), info='登录IP')
    lastLoginTime = db.Column(db.DateTime, info='最后一次登录时间')
    isValid = db.Column(db.Integer, server_default=db.FetchedValue(), info='是否有效；0--无效；1--有效；  系统管理员临时控制位')
    addTime = db.Column(db.DateTime, server_default=db.FetchedValue(), info='添加时间')
